using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using QuanLyThietBi.Config;     
using QuanLyThietBi.Entity;
namespace QuanLyThietBi.ManagerBase
{
                

     public abstract class TBL_DonViTinhManagerBase
    {
        public TBL_DonViTinhManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>TBL_DonViTinhEntity</returns>
        public TBL_DonViTinhEntity Insert(TBL_DonViTinhEntity obj)
        { 
            return (TBL_DonViTinhEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>TBL_DonViTinhEntity</returns>
        public TBL_DonViTinhEntity Update(TBL_DonViTinhEntity obj)
        { 
            return (TBL_DonViTinhEntity)Adapter.Update(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo dieu kien trong object
        /// </summary>
        /// <returns>TBL_DonViTinhEntity</returns>
        public TBL_DonViTinhEntity UpdateWithCondition(TBL_DonViTinhEntity obj,TBL_DonViTinhEntity objCond)
        { 
            return (TBL_DonViTinhEntity)Adapter.UpdateWithCondition(obj,objCond);             
        }
 
 
        public TBL_DonViTinhEntity Delete(TBL_DonViTinhEntity obj)
        { 
            return (TBL_DonViTinhEntity)Adapter.Delete(obj);             
        }
 
 
        public TBL_DonViTinhEntity DeleteWithCondition(TBL_DonViTinhEntity objCond)
        { 
            return (TBL_DonViTinhEntity)Adapter.DeleteWithCondition(objCond);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaDonVi duoc set trong object
        /// </summary>
        /// <returns>TBL_DonViTinhEntity</returns>
        public TBL_DonViTinhEntity DeleteByMaDonVi (TBL_DonViTinhEntity obj)
        { 
            return (TBL_DonViTinhEntity)Adapter.DeleteByField(obj,"MaDonVi");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaDonVi 
        /// </summary>
        /// <returns>TBL_DonViTinhEntity</returns>
        public TBL_DonViTinhEntity DeleteByMaDonVi (string MaDonVi )
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.MaDonVi = MaDonVi;  
            return (TBL_DonViTinhEntity)Adapter.DeleteByField(obj,"MaDonVi");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>TBL_DonViTinhEntity</returns>
        public TBL_DonViTinhEntity DeleteByMoTa (TBL_DonViTinhEntity obj)
        { 
            return (TBL_DonViTinhEntity)Adapter.DeleteByField(obj,"MoTa");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MoTa 
        /// </summary>
        /// <returns>TBL_DonViTinhEntity</returns>
        public TBL_DonViTinhEntity DeleteByMoTa (string MoTa )
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.MoTa = MoTa;  
            return (TBL_DonViTinhEntity)Adapter.DeleteByField(obj,"MoTa");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TenDonVi duoc set trong object
        /// </summary>
        /// <returns>TBL_DonViTinhEntity</returns>
        public TBL_DonViTinhEntity DeleteByTenDonVi (TBL_DonViTinhEntity obj)
        { 
            return (TBL_DonViTinhEntity)Adapter.DeleteByField(obj,"TenDonVi");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TenDonVi 
        /// </summary>
        /// <returns>TBL_DonViTinhEntity</returns>
        public TBL_DonViTinhEntity DeleteByTenDonVi (string TenDonVi )
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.TenDonVi = TenDonVi;  
            return (TBL_DonViTinhEntity)Adapter.DeleteByField(obj,"TenDonVi");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public TBL_DonViTinhEntity Select(TBL_DonViTinhEntity obj)
        { 
            return (TBL_DonViTinhEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(TBL_DonViTinhEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(TBL_DonViTinhEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new TBL_DonViTinhEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new TBL_DonViTinhEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<TBL_DonViTinhEntity> SelectAllLST()
        { 
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new TBL_DonViTinhEntity()),new TBL_DonViTinhEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<TBL_DonViTinhEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new TBL_DonViTinhEntity(),option),new TBL_DonViTinhEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaDonVi duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaDonVi (TBL_DonViTinhEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaDonVi");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaDonVi duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaDonVi (TBL_DonViTinhEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaDonVi",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaDonVi duoc set trong object
        /// </summary>
        /// <returns>List<TBL_DonViTinhEntity></returns>
        public List<TBL_DonViTinhEntity> SelectByMaDonViLST (TBL_DonViTinhEntity obj)
        { 
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaDonVi"),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaDonVi duoc set trong object
        /// </summary>
        /// <returns>List<TBL_DonViTinhEntity></returns>
        public List<TBL_DonViTinhEntity> SelectByMaDonViLST (TBL_DonViTinhEntity obj,SelectOptions option)
        { 
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaDonVi",option),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaDonVi 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaDonVi (string MaDonVi )
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.MaDonVi = MaDonVi;  
            return Adapter.SelectByField(obj,"MaDonVi");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaDonVi duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaDonVi (string MaDonVi, SelectOptions option)
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.MaDonVi = MaDonVi;  
            return Adapter.SelectByField(obj,"MaDonVi",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaDonVi 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_DonViTinhEntity> SelectByMaDonViLST (string MaDonVi )
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.MaDonVi = MaDonVi;  
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaDonVi"),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaDonVi duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_DonViTinhEntity> SelectByMaDonViLST (string MaDonVi, SelectOptions option)
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.MaDonVi = MaDonVi;  
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaDonVi",option),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTa (TBL_DonViTinhEntity obj)
        { 
            return Adapter.SelectByField(obj,"MoTa");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTa (TBL_DonViTinhEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MoTa",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>List<TBL_DonViTinhEntity></returns>
        public List<TBL_DonViTinhEntity> SelectByMoTaLST (TBL_DonViTinhEntity obj)
        { 
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MoTa"),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>List<TBL_DonViTinhEntity></returns>
        public List<TBL_DonViTinhEntity> SelectByMoTaLST (TBL_DonViTinhEntity obj,SelectOptions option)
        { 
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MoTa",option),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTa (string MoTa )
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.MoTa = MoTa;  
            return Adapter.SelectByField(obj,"MoTa");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTa (string MoTa, SelectOptions option)
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.MoTa = MoTa;  
            return Adapter.SelectByField(obj,"MoTa",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_DonViTinhEntity> SelectByMoTaLST (string MoTa )
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.MoTa = MoTa;  
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MoTa"),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTa duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_DonViTinhEntity> SelectByMoTaLST (string MoTa, SelectOptions option)
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.MoTa = MoTa;  
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MoTa",option),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenDonVi duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenDonVi (TBL_DonViTinhEntity obj)
        { 
            return Adapter.SelectByField(obj,"TenDonVi");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenDonVi duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenDonVi (TBL_DonViTinhEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"TenDonVi",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenDonVi duoc set trong object
        /// </summary>
        /// <returns>List<TBL_DonViTinhEntity></returns>
        public List<TBL_DonViTinhEntity> SelectByTenDonViLST (TBL_DonViTinhEntity obj)
        { 
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenDonVi"),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenDonVi duoc set trong object
        /// </summary>
        /// <returns>List<TBL_DonViTinhEntity></returns>
        public List<TBL_DonViTinhEntity> SelectByTenDonViLST (TBL_DonViTinhEntity obj,SelectOptions option)
        { 
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"TenDonVi",option),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenDonVi 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenDonVi (string TenDonVi )
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.TenDonVi = TenDonVi;  
            return Adapter.SelectByField(obj,"TenDonVi");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenDonVi duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenDonVi (string TenDonVi, SelectOptions option)
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.TenDonVi = TenDonVi;  
            return Adapter.SelectByField(obj,"TenDonVi",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenDonVi 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_DonViTinhEntity> SelectByTenDonViLST (string TenDonVi )
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.TenDonVi = TenDonVi;  
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenDonVi"),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenDonVi duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_DonViTinhEntity> SelectByTenDonViLST (string TenDonVi, SelectOptions option)
        { 
            TBL_DonViTinhEntity obj = new TBL_DonViTinhEntity();
            obj.TenDonVi = TenDonVi;  
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenDonVi",option),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<TBL_DonViTinhEntity></returns>
        public List<TBL_DonViTinhEntity> SelectWithConditionLST (TBL_DonViTinhEntity obj)
        { 
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new TBL_DonViTinhEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<TBL_DonViTinhEntity></returns>
        public List<TBL_DonViTinhEntity> SelectWithConditionLST (TBL_DonViTinhEntity obj,SelectOptions option)
        { 
            return  (List<TBL_DonViTinhEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new TBL_DonViTinhEntity());
        }

}
}
